function IDMS_UpdateChart(idNotation,name)
{
	document.getElementById("indices_loading").style.display = "block";
	document.getElementById("IDMS_IndexChart").src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION="+idNotation;

	document.getElementById("IDMS_IndexName").innerHTML = name;
//	MakeAjaxCall(notation);
}


	//		var pic0 = new Image(221,121);
//		pic0.src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION=324977";
	//		var pic1 = new Image(221,121);
//		pic1.src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION=1918069";
	//		var pic2 = new Image(221,121);
//		pic2.src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION=8354115";
	//		var pic3 = new Image(221,121);
//		pic3.src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION=324985";
	//		var pic4 = new Image(221,121);
//		pic4.src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION=20735";
	//		var pic5 = new Image(221,121);
//		pic5.src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION=324933";
	//		var pic6 = new Image(221,121);
//		pic6.src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION=324913";
	//		var pic7 = new Image(221,121);
//		pic7.src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION=4359526";
	//		var pic8 = new Image(221,121);
//		pic8.src = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&WIDTH=221&HEIGHT=121&ID_NOTATION=8941836";
	
document.writeln('<link href="http://www.showcase.idmanagedsolutions.com/idc/css/IDMSstyle.css" rel="stylesheet" type="text/css" />');
document.writeln('<div id="IDMS_MarketBox" class="IDMShomeIndices">');
//document.writeln('	<div>');
//document.writeln('		<h3>Markets</h3>');
//document.writeln('		<div id="clear"></div>');
//document.writeln('	</div>');
document.writeln('	<div id="IDMSindextable" style="margin-right:2px;">');
document.writeln('		<table>');
			
document.writeln('			<tr onmouseover="IDMS_UpdateChart(\'324977\',\'Dow Jones\')">');
document.writeln('					<td class="flag"><img src="http://www.showcase.idmanagedsolutions.com/idc/images/flag_USD.gif" width="16" height="11"></td>');
document.writeln('				<td class="left">&nbsp;&nbsp;Dow Jones</td>');
document.writeln('				<td class="last">13,306.64</td>');
document.writeln('				<td class="positive">+14.64</td>');
document.writeln('				<td><img src="http://www.showcase.idmanagedsolutions.com/idc/images/select_arrow.gif" alt="" width="7" height="15" /></td>');
document.writeln('			</tr>');
			
document.writeln('			<tr onmouseover="IDMS_UpdateChart(\'1918069\',\'FTSE 100\')">');
document.writeln('					<td class="flag"><img src="http://www.showcase.idmanagedsolutions.com/idc/images/flag_FTSE.gif" width="16" height="11"></td>');
document.writeln('				<td class="left">&nbsp;&nbsp;FTSE 100</td>');
document.writeln('				<td class="last">5,792.52</td>');
document.writeln('				<td class="negative">-2.28</td>');
document.writeln('				<td><img src="http://www.showcase.idmanagedsolutions.com/idc/images/select_arrow.gif" alt="" width="7" height="15" /></td>');
document.writeln('			</tr>');
			
document.writeln('			<tr onmouseover="IDMS_UpdateChart(\'8354115\',\'NYSE\')">');
document.writeln('					<td class="flag"><img src="http://www.showcase.idmanagedsolutions.com/idc/images/flag_USD.gif" width="16" height="11"></td>');
document.writeln('				<td class="left">&nbsp;&nbsp;NYSE</td>');
document.writeln('				<td class="last">8,234.51</td>');
document.writeln('				<td class="positive">+73.95</td>');
document.writeln('				<td><img src="http://www.showcase.idmanagedsolutions.com/idc/images/select_arrow.gif" alt="" width="7" height="15" /></td>');
document.writeln('			</tr>');
			
document.writeln('			<tr onmouseover="IDMS_UpdateChart(\'324985\',\'Nasdaq\')">');
document.writeln('					<td class="flag"><img src="http://www.showcase.idmanagedsolutions.com/idc/images/flag_USD.gif" width="16" height="11"></td>');
document.writeln('				<td class="left">&nbsp;&nbsp;Nasdaq</td>');
document.writeln('				<td class="last">3,136.42</td>');
document.writeln('				<td class="positive">+0.61</td>');
document.writeln('				<td><img src="http://www.showcase.idmanagedsolutions.com/idc/images/select_arrow.gif" alt="" width="7" height="15" /></td>');
document.writeln('			</tr>');
			
document.writeln('			<tr onmouseover="IDMS_UpdateChart(\'20735\',\'DAX\')">');
document.writeln('					<td class="flag"><img src="http://www.showcase.idmanagedsolutions.com/idc/images/flag_DAX.gif" width="16" height="11"></td>');
document.writeln('				<td class="left">&nbsp;&nbsp;DAX</td>');
document.writeln('				<td class="last">7,215.11</td>');
document.writeln('				<td class="positive">+0.61</td>');
document.writeln('				<td><img src="http://www.showcase.idmanagedsolutions.com/idc/images/select_arrow.gif" alt="" width="7" height="15" /></td>');
document.writeln('			</tr>');
			
document.writeln('			<tr onmouseover="IDMS_UpdateChart(\'324933\',\'Hang Seng\')">');
document.writeln('					<td class="flag"><img src="http://www.showcase.idmanagedsolutions.com/idc/images/flag_HANGSENG.gif" width="16" height="11"></td>');
document.writeln('				<td class="left">&nbsp;&nbsp;Hang Seng</td>');
document.writeln('				<td class="last">19,827.17</td>');
document.writeln('				<td class="positive">+25.01</td>');
document.writeln('				<td><img src="http://www.showcase.idmanagedsolutions.com/idc/images/select_arrow.gif" alt="" width="7" height="15" /></td>');
document.writeln('			</tr>');
			
document.writeln('			<tr onmouseover="IDMS_UpdateChart(\'324913\',\'Nikkei 225\')">');
document.writeln('					<td class="flag"><img src="http://www.showcase.idmanagedsolutions.com/idc/images/flag_NIKKEI.gif" width="16" height="11"></td>');
document.writeln('				<td class="left">&nbsp;&nbsp;Nikkei 225</td>');
document.writeln('				<td class="last">8,869.37</td>');
document.writeln('				<td class="negative">-2.28</td>');
document.writeln('				<td><img src="http://www.showcase.idmanagedsolutions.com/idc/images/select_arrow.gif" alt="" width="7" height="15" /></td>');
document.writeln('			</tr>');
			
document.writeln('			<tr onmouseover="IDMS_UpdateChart(\'4359526\',\'S&P 500\')">');
document.writeln('					<td class="flag"><img src="http://www.showcase.idmanagedsolutions.com/idc/images/flag_USD.gif" width="16" height="11"></td>');
document.writeln('				<td class="left">&nbsp;&nbsp;S&P 500</td>');
document.writeln('				<td class="last">1,437.92</td>');
document.writeln('				<td class="positive">+5.80</td>');
document.writeln('				<td><img src="http://www.showcase.idmanagedsolutions.com/idc/images/select_arrow.gif" alt="" width="7" height="15" /></td>');
document.writeln('			</tr>');
			
document.writeln('			<tr onmouseover="IDMS_UpdateChart(\'8941836\',\'Russell 2000\')">');
document.writeln('					<td class="flag"><img src="http://www.showcase.idmanagedsolutions.com/idc/images/flag_USD.gif" width="16" height="11"></td>');
document.writeln('				<td class="left">&nbsp;&nbsp;Russell 2000</td>');
document.writeln('				<td class="last">842.27</td>');
document.writeln('				<td class="positive">+4.32</td>');
document.writeln('				<td><img src="http://www.showcase.idmanagedsolutions.com/idc/images/select_arrow.gif" alt="" width="7" height="15" /></td>');
document.writeln('			</tr>');
			document.writeln('		</table>');
document.writeln('	</div>');
document.writeln('	<div class="indexChart">');
document.writeln('	<table style="width:230px; border:1px solid gray; padding:2px;" cellpadding="2"><tr><td style="text-align:left;"><div id="IDMS_IndexName"> Dow Jones</div></td><td style="text-align:right;"><div id="HistoricalData"> &nbsp; </div></td></tr>');
document.writeln('<tr><td colspan="2">');
document.writeln('		<div id="indices_loading" class="LoadingImage"></div>');
document.writeln('		<img id="IDMS_IndexChart" onmousemove="ShowHistoricalData(event)" src="http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?LANG=en&ID_NOTATION=324977&WIDTH=221&HEIGHT=121" width="221" height="121" onload="document.getElementById(\'indices_loading\').style.display=\'none\';" />');
document.writeln('                  </td></tr></table>');
document.writeln('                  <div class="more"><a target="_top" href="http://www.interactivedata.com/index.php/Contents/show/content/worldMarkets" style="float:left;">Additional Market information</a></div>');
document.writeln('	</div>');
document.writeln('</div>');
var HISTORICAL_DATA;
var chartReq;
function MakeAjaxCall(notation)
{
	chartReq = initRequest();
	var url = "http://www.showcase.idmanagedsolutions.com/charts/clients/idc/corp/quote/quote.chart?JAVASCRIPT=1&WIDTH=221&HEIGHT=121&ID_NOTATION=" + notation;
	chartReq.open("POST", url, true);
	chartReq.onreadystatechange = callBackChartReq;
	chartReq.send(null);
}

var plotHistoricalData;
		function callBackChartReq()
		{
			
			if (chartReq.readyState == 4)
			{
			
				if (chartReq.status == 200)
				{
					if (chartReq.responseText.length > 0)
					{
						aPlotx = new Array();
						aPloty = new Array();
						aPlotPrice = new Array();

						var jsonExpression = "(" + chartReq.responseText + ")";
						var jsonObj = eval(jsonExpression);
						plotHistoricalData = jsonObj;
					}
					HISTORICAL_DATA = 1;
				}
			}
		}
		function initRequest() {
			var xmlHttpRequest;
			try
			{
				xmlHttpRequest = new XMLHttpRequest();
			}
			catch(e)
			{
				try
				{
					xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch (e)
				{
					try
					{
						xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch (e)
					{
						alert("Your browser does not support AJAX!");
					}
				}
			}
			return xmlHttpRequest;
		}

		function ShowHistoricalData(event)
		{
			if (HISTORICAL_DATA == 1)
			{
				var low = 0;
				var high = plotHistoricalData.plotList.length -1;
				var x=event.clientX - document.getElementById("IDMS_MarketBox").offsetLeft - 220;
				while (low <= high) {
					mid = parseInt((low + high) / 2)
					element = plotHistoricalData.plotList[mid].x;
					if (element > x) {
						high = mid - 1;
					} else if (element < x) {
						low = mid + 1;
					} else {
						//return mid;
						if (mid >= (plotHistoricalData.plotList.length -1))
						{
							mid = plotHistoricalData.plotList.length -2;
						}

						if (mid <= 0)
						{
							mid = 0;
						}
				
						document.getElementById("HistoricalData").innerHTML = plotHistoricalData.plotList[mid].last;
						break;
					}
				}
			}
		}
